package com.shunlin.paopaoku.box2d;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.OrthographicCamera;

//存放常量的类

public abstract class Box2DVars {
    public static final float PPM = 100; //因为Box2D世界的单位是米，而安卓的单位是像素，所以要进行一个转换设置一个PPM，以后Box2d世界中的刚体的位置和大小都要除以PPM

    public static float width, height;

    public static OrthographicCamera b2dCamera; //绘制Box2D世界要用到的相机

    public static short BIT_GROUND = 1; //设置地板的自身属性
    public static short BIT_PLAYER = 2; //设置玩家的自身属性
    public static short BIT_STAR = 4; //设置星星的自身属性

    static { //初始化静态的成员变量
        width = Gdx.graphics.getWidth(); //拿到屏幕的宽
        height = Gdx.graphics.getHeight();

        b2dCamera = new OrthographicCamera();
        b2dCamera.setToOrtho(false, width / 2 / PPM, height / 2 / PPM); //设置相机视点位于屏幕正中央
    }
}
